import request from '@/utils/request';

// 获取角色详情
export function getRoleDetailApi(objectId) {
  let url = process.env.VUE_APP_SYS_SERVICE + 'api/sysRole/getById';
  return request({
    url: url,
    method: 'get',
    params: { objectId }
  });
}

// 组织架构
export function getSysStructsTreeApi() {
  return request({
    url: process.env.VUE_APP_SYS_SERVICE + 'api/sysStruct/getSysStructsTree',
    method: 'get'
  });
}

// 获取系统组织架构
export function getSysMenuTreeApi(postData) {
  return request({
    url: process.env.VUE_APP_SYS_SERVICE + 'api/sysMenu/getMenuTree',
    method: 'post',
    data: postData
  });
}

// 更新角色权限
export function updateRolePermissionsApi(postData) {
  return request({
    url: process.env.VUE_APP_SYS_SERVICE + 'api/sysRolePermission/updateRolePermissionsBatch',
    method: 'post',
    data: {
      params: postData
    }
  });
}
